/**
 * Created by Sravyatha on 2/4/2015.
 */


$(document).ready(function(){
    var images = ['https://articulate-heroes.s3.amazonaws.com/uploads/rte/pqzvkdbe_HTML5-Present-Past-and-Future.jpg',
        'https://jayeshcp.files.wordpress.com/2013/03/twitter-bootstrap.jpg',
        'http://howtodoinjava.com/wp-content/uploads/jquery_logo.png'];

    var i=0;
    $('#back').hide();
    $("#currentImage").attr("src",images[i]);


  $('#next').click(function(){

            i++;
            $("#currentImage").attr("src", images[i]);
            $('#back').show();
          if(i==images.length-1){
              $('#next').hide();
          }


    })

    $('#back').click(function(){

            i--;
            $("#currentImage").attr("src", images[i]);
            $('#next').show();
            if(i==0){
                $('#back').hide();
            }
    })

});